@extends('layout.master')

@section('title','添加评论')

@section('css')
    @parent
    <link href="{{ asset('plugins/bower_components/summernote/dist/summernote.css') }}" rel="stylesheet"/>
    <!-- animation CSS -->
    <link href="{{ asset('css/animate.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/icheck/skins/all.css') }}" rel="stylesheet">
    <link href="{{ asset('plugins/bower_components/bootstrap-switch/bootstrap-switch.min.css') }}" rel="stylesheet">
@endsection
@section('main')
    @if (session('message'))
        <div>
            <input type="hidden" id="hidden" name="hidden" value="hidden">
            <input type="hidden" id="message" name="message" value="{{ session('message') }}">
            <input type="hidden" id="status" name="status" value="{{ session('status') }}">
        </div>
    @endif
    <div class="white-box">
        <form class="form-horizontal form-material" method="post" id='formid' enctype="multipart/form-data">
	
			<div class="row">	
				<input type="hidden" id="hidden" name="article_id" value="{{$id}}">
                <div class="col-md-2 col-sm-4">
                    <label class="control-label">发布用户名</label>
                    <div class="example">
                        <select id="user_id" name="user_id">
							@foreach(App\User::PostingsUsers() as $value)
                                <option value="{{ $value->c_id}}">{{ $value->name }}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
				
			</div>
	
            <div class="row">
				<div class="form-group m-b-40 m-t-10">
					<p for="remarks">内容</p>
					<textarea id="content" name="content" cols="80" rows="5"></textarea>
				</div>
            </div>

        
        <div class="form-group">
            <button class="fcbtn btn btn-success btn-outline btn-1e waves-effect" id="publish">添加
            </button>

            {!! csrf_field() !!}
            <a class="fcbtn btn btn-info btn-outline btn-1e waves-effect" href="/zixun/repay/{{$id}}">返回
            </a>
        </div>
	</form>
    </div>

@endsection
@section('js')
    @parent
    <script>
       /* $(document).ready(function () {
            $('#summernote').summernote();
        });
        $('#summernote').summernote({
            height: 500,
            toolbar: [
                // [groupName, [list of button]]
                ['style', ['bold', 'italic', 'underline', 'clear']],
                ['fontsize', ['fontsize']],
                ['fontname', ['fontname']],
                ['color', ['color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height', ['height']],
                ['insert', ['link', 'picture', 'video']],
                ['view', ['fullscreen', 'codeview', 'help']]
            ],
            lang: 'zh-CN',
            placeholder: '内容',
            dialogsFade: true,
            callbacks: {
                onImageUpload: function (files) {
                    var data = new FormData();
                    data.append("file", files[0]);
                    $.ajax({
                        data: data,
                        type: "POST",
                        headers: {
                            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
                        },
                        url: "/upload", //填写后台上传文件的路径
                        cache: false,
                        contentType: false,
                        processData: false,
                        success: function (url) {//url为上传成功后返回的图片路径
                            var imgNode = document.createElement('img');
                            imgNode.src = url;
                            $('#summernote').summernote('insertNode', imgNode);
                        }
                    })
                }
            }
        });*/



    </script>
@endsection